package com.android.jingweiapp.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by cuiwenrui-pc on 15/11/15.
 */
public class TopicBean implements Parcelable {


    /**
     * id : 144
     * title : 中国-蒙古国博览会
     * path : 134642.jpg
     * secondList : [{"id":"17","secondName":"中国-蒙古国博览会"}]
     */

    private List<DataEntity> data;

    public void setData(List<DataEntity> data) {
        this.data = data;
    }

    public List<DataEntity> getData() {
        return data;
    }

    public static class DataEntity implements Parcelable {
        private String id;
        private String title;
        private String path;
        /**
         * id : 17
         * secondName : 中国-蒙古国博览会
         */

        private List<SecondListEntity> secondList;

        public void setId(String id) {
            this.id = id;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public void setSecondList(List<SecondListEntity> secondList) {
            this.secondList = secondList;
        }

        public String getId() {
            return id;
        }

        public String getTitle() {
            return title;
        }

        public String getPath() {
            return path;
        }

        public List<SecondListEntity> getSecondList() {
            return secondList;
        }

        public static class SecondListEntity implements Parcelable {
            private String id;
            private String secondName;

            public void setId(String id) {
                this.id = id;
            }

            public void setSecondName(String secondName) {
                this.secondName = secondName;
            }

            public String getId() {
                return id;
            }

            public String getSecondName() {
                return secondName;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.id);
                dest.writeString(this.secondName);
            }

            public SecondListEntity() {
            }

            protected SecondListEntity(Parcel in) {
                this.id = in.readString();
                this.secondName = in.readString();
            }

            public static final Parcelable.Creator<SecondListEntity> CREATOR = new Parcelable.Creator<SecondListEntity>() {
                public SecondListEntity createFromParcel(Parcel source) {
                    return new SecondListEntity(source);
                }

                public SecondListEntity[] newArray(int size) {
                    return new SecondListEntity[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.title);
            dest.writeString(this.path);
            dest.writeTypedList(secondList);
        }

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.id = in.readString();
            this.title = in.readString();
            this.path = in.readString();
            this.secondList = in.createTypedArrayList(SecondListEntity.CREATOR);
        }

        public static final Parcelable.Creator<DataEntity> CREATOR = new Parcelable.Creator<DataEntity>() {
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedList(data);
    }

    public TopicBean() {
    }

    protected TopicBean(Parcel in) {
        this.data = in.createTypedArrayList(DataEntity.CREATOR);
    }

    public static final Parcelable.Creator<TopicBean> CREATOR = new Parcelable.Creator<TopicBean>() {
        public TopicBean createFromParcel(Parcel source) {
            return new TopicBean(source);
        }

        public TopicBean[] newArray(int size) {
            return new TopicBean[size];
        }
    };
}
